<!DOCTYPE html>
<html>
<head>
    <title>reports group</title>
    <meta content="text/html; charset=UTF-8" http-equiv=Content-Type>
    <link rel=stylesheet type=text/css href="<?php echo STATIC_DOMAIN ?>assets/bingo.css">
    <script type="text/javascript">
        var base_url = '<?php echo STATIC_DOMAIN ?>';
    </script>
    <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.jeditable.js"></script>
    <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.jeditable.masked.js"></script>
    <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.jeditable.autogrow.js"></script>
    <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.autogrow.js"></script>
    <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.maskedinput.js"></script>
    <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/js/jquery.validate.js"></script>
    <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/custom.js"></script>
    <script type="text/javascript" src="<?php echo STATIC_DOMAIN ?>assets/app.users.js"></script>

    <?php if(Identity::getInstance()->getRole() == '-1'): ?>
        <style type="text/css">
            /*Editable In line*/
            /*            .editable {
                            width:200px;
                            position: absolute;
                            z-index: 9999;
                        }*/

            .editable select {
                border: 1px solid #C8C8C8;
                padding: 2px 2px 3px;
                color: #666666;
                background: #fff;
                outline: none;
            }

            .editable select option {
                outline: none;
            }

            .editable > button {
                /*font: bold 84% 'trebuchet ms',helvetica,sans-serif;*/
                border: 1px solid #C8C8C8;
                background: #fff;
                text-align: center;
                padding: 2px 8px 3px;
            }

            .editable > input {
                padding: 5px 5px 5px;
                min-width: 100px;
                border: 1px solid #C8C8C8;
                height: auto !important;
            }
            .editTrigger {
                cursor: pointer;
                display: none;
            }
            .weekReport tr td:hover .editTrigger {
                display: inline-block;
            }
            .weekReport tr td {
                padding: 5px 10px;
            }
        </style>
    <?php endif; ?>
</head>
<body oncontextmenu=window.event.returnValue=false leftmargin=0 topmargin=0 bgcolor=#ffffff text=#000000 onload="$$.app.users.init()" style="padding-left: 10px">
<table cellspacing=1 cellpadding=0 width=500 bgcolor=#000000 border=0 class="weekReport">
    <tbody>
    <tr class=rp_top1 align=center bgcolor=#6b7584>
        <td height=19 colspan=4>
            <font color=#ffffff>Quản lý tài khoản</font>
        </td>
    </tr>
    <tr class=rp_top1 align=center bgcolor=#6b7584>
        <td height=19 width=150>
            <font color=#ffffff>Tài khoản hội viên</font>
        </td>
        <td height=19 width=150>
            <font color=#ffffff>Mật khẩu</font>
        </td>
        <td height=19 width=80>
            <font color=#ffffff>Loại tài khoản</font>
        </td>
        <td width="">&nbsp;</td>
    </tr>
    <?php foreach($allUsers as $user): ?>
        <tr onmouseover="this.bgColor = '#FFCC30';" onmouseout="this.bgColor = '#FFFFFF';" align=right bgcolor=#ffffff data-id="<?php echo $user['id'] ?>" class="userItem">
            <td height=19>
                <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                <span class="objEditable" data-name="user"><?php echo $user['user'] ?></span>
            </td>
            <td height=19>
                <img src="<?php echo STATIC_DOMAIN ?>assets/images/edit.png" class="editTrigger"/>
                <span class="objEditable" data-name="pwd"></span>
            </td>
            <td height=19>
                <span class="objEditableSlc" data-name="role"><?php echo ($user['role'] == -1) ? 'Admin' : 'User' ?></span>
            </td>
            <td><a href="<?php echo site_url("auth/rm/{$user['id']}") ?>" class="remove">Xóa</a></td>
        </tr>
    <?php endforeach; ?>
    </tbody>
</table>
<br>
<div class="formCreate">
<input type="button" value="Thêm mới user" class="inputForm addNew"/>
<div class="content-border" style="">
    <form name="addNewUser" class="addNewUser" method="post" action="<?php echo site_url('auth/add') ?>">
        <label><b>Tên tài khoản</b></label><br/>
        <input type="text" class="inputForm" id="user" name="user" value="" placeholder="Nhập tên tài khoản"/><br/>
        <label><b>Tên người dùng</b></label><br/>
        <input type="password" class="inputForm" name="pwd" id="pwd" value="" placeholder="Nhập mật khẩu"/><br/>
        <label><b>Loại tài khoản</b></label>
        <select name="role" id="role">
            <option value="-1">Admin</option>
            <option value="1" selected="selected">User</option>
        </select><br/>
        <input type="submit" value="Tạo" class="inputForm submitForm"/>
    </form>
</div>
</div>
</body>
</html>